class Solution:
    def minWindow(self, s: str, t: str) -> str:
        from collections import defaultdict
        check = defaultdict(int)
        for c in t:
            check[c] -= 1
        i = 0
        re = ""
        result = float('inf')
        for j in range(len(s)):
            if s[j] in check:
                check[s[j]] += 1
            while j >= i and ((s[i] in check and check[s[i]]) or s[i] not in check):
                check[s[i]] -= 1
                i += 1
        if j-i+1<result:
            re = s[i:j+1]
            result = j-i+1
        return re
    

s = Solution()
result = s.minWindow(s = "a", t = "aa")
print(result)
